namespace go admin_product_specifications
include "error_code.thrift"

struct Specifications {
    1: i64 ID(api.body="id")
    2: string Name(api.body="name")
    3: list<SpecificationsValue> Value(api.body='value')
    4: i64 CreateTime(api.body='create_time')
}

struct SpecificationsValue {
    1: string Value(api.body='value')
    2: list<string> Detail(api.body='detail')
}

struct CreateSpecificationsRequest {
    1: string Name (api.body='name')
    2: list<SpecificationsValue> Value (api.body='value')
}

struct CreateSpecificationsResponse {
    1: error_code.ErrorCode Code (api.body='code')
}

struct GetSpecificationsListRequest {
    1: i64 Page = 1 (api.query="page");
    2: i64 Size = 20 (api.query="size");
    3: string Name (api.body='name')
}

struct GetSpecificationsListResponse {
    1: error_code.ErrorCode Code (api.body='code')
    2: list<Specifications> Data (api.body='data')
    3: i64 Total (api.body='total')
}

struct DeleteSpecificationsRequest {
    1: list<i64> IDs (api.body="ids")
}

struct DeleteSpecificationsResponse {
    1: error_code.ErrorCode Code (api.body='code')
}

struct UpdateSpecificationsRequest {
    1: i64 ID (api.query="id")
    2: optional string Name (api.body='name')
    3: optional list<SpecificationsValue> Value (api.body='value')
}

struct UpdateSpecificationsResponse {
    1: error_code.ErrorCode Code (api.body='code')
}

struct FormatSpecificationsHeader {
    1: string Title(api.body='title')
    2: string Align(api.body='align')
    3: string Slot(api.body='slot')
    4: string Key(api.body='key')
    5: i64 MinWidth(api.body='min_width')
}

struct FormatSpecificationsRequest {
    1: i64 ID (api.body='id')
    2: list<SpecificationsValue> Attrs (api.body='attrs')
}

struct FormatSpecificationsResponse {
    1: error_code.ErrorCode Code (api.body='code')
}
